<%
'-------------------  Validate date as hhmmss ---------------------------------

Public Function ValidateTime(ByVal strTime, ByVal strTimeType)


Dim strHour
Dim strMinute
Dim strSecond
Dim strErrMsg

strErrMsg = ""


If Len(strTime) < 6 Then
    strErrMsg = "Please enter the " & strTimeType & " time in the format hhmmss."
Else
	strHour = Left(strTime,2)
	strMinute = Mid(strTime,3,2)
	strSecond = Right(strTime,2)
	
	If (cstr(strHour) > "23" ) Then
	    strErrMsg = strTimeType & " hour cannot be greater than 23"
	ElseIf (cstr(strMinute) > "59") Then
	    strErrMsg = strTimeType & " minute cannot be greater than 59"
	ElseIf (cstr(strSecond) > "59") Then
	    strErrMsg = strTimeType & " second cannot be greater than 59"
	End If
end if

ValidateTime = strErrMsg

End Function 'ValidateTime()
%>		